// msock.h
// class CMSocket
//

class CMSocket
{
    public:
        CMSocket();
        ~CMSocket();

    public:
        int start(void *pCM, const char *ip, const char *port);
        void end();

    protected:
        int Create();
        int CreateAndBindToLocal(const char *port);
        int EPoll();
        void AcceptEPollClient(struct epoll_event &event);

    public:
        static int MakeNonBlocking(int fd);

    private:
        int _sfd;   // server fd
        int _efd;   // epoll fd
        void *_pCM;
//        int _version;
};

